﻿using RuoVea.ExSugar.Attributes;
using RuoVea.ExSugar.Entity;
using SqlSugar;
using System.ComponentModel;

namespace RuoVea.OmiApi.Article.Entitys;

/// <summary>
/// 分类表
/// </summary>
[SugarTable(nameof(ArtSeo), TableDescription = "文章SEO信息表")]
[Description("文章SEO信息表")]
[SugarIndex($"IX_{nameof(ArtSeo)}_{nameof(ArticleId)}", nameof(ArticleId), OrderByType.Asc, true)] // 文章ID唯一索引
public class ArtSeo : EntityBase
{
    /// <summary>
    /// 文章ID
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(ArticleId), columnDescription: "文章ID")]
    public long ArticleId { get; set; }

    /// <summary>
    /// SEO标题
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(MetaTitle), columnDescription: "SEO标题", Length = 200)]
    public string MetaTitle { get; set; }

    /// <summary>
    /// SEO关键词
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(MetaKeywords), columnDescription: "SEO关键词", Length = 500)]
    public string MetaKeywords { get; set; }

    /// <summary>
    /// SEO描述
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(MetaDescription), columnDescription: "SEO描述", Length = 1000)]
    public string MetaDescription { get; set; }

    /// <summary>
    /// 规范URL
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(CanonicalUrl), columnDescription: "规范URL", Length = 500)]
    public string CanonicalUrl { get; set; }

    /// <summary>
    /// 导航属性 - 文章（一对一关系）
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ArticleId))]
    [SugarColumn(IsIgnore = true)]
    public ArtArticle Article { get; set; }
}